function onFieldFocus()
{
	event.srcElement.style.background = "#d0d0ff";
}
function onFieldBlur()
{
	event.srcElement.style.background = "transparent";
}
function onDateFieldBlur()
{
	if (!dqOnFocusOutDate(1))
	{
		return false;
	}
	
	onFieldBlur();
	return true;
}
function onTimeFieldBlur()
{
	if (!dqOnFocusOutTime(1))
	{
		return false;
	}
	
	onFieldBlur();
	return true;
}
function onDatetimeFieldBlur()
{
	if (!dqOnFocusOutDatetime(1))
	{
		return false;
	}
	
	onFieldBlur();
	return true;
}
function onDateFieldDblclick()
{
	var d = new Date();
	event.srcElement.value = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
}
function onYearFieldDblclick()
{
	var d = new Date();
	event.srcElement.value = d.getFullYear();
}
function onMonthFieldDblclick()
{
	var d = new Date();
	event.srcElement.value = d.getMonth() + 1;
}
function diffMonths(fromDate, toDate)
{
	if (10 == fromDate.length && 10 == toDate.length)
	{
		var v = fromDate.split("-");
		var oFrom = new Date(v[0], v[1], v[2]);
		var v = toDate.split("-");
		var oTo = new Date(v[0], v[1], v[2]);
	
		return (oTo.getFullYear() - oFrom.getFullYear()) * 12 + (oTo.getMonth() - oFrom.getMonth());
	}
	
	return '0';
}
